import Vue from 'vue'
import Vuex from 'vuex'
// 1引入持久化插件
import vuexPersistedstate from "vuex-persistedstate";

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
      token: '',
      username: ''
  },
  getters: {
  },
  mutations: {
      setUsername(state, Username) {
          state.Username = Username;
      },
      setToken(state, token) {
          state.token = token;
      }
  },
  actions: {
  },
  modules: {
  },
plugins:[vuexPersistedstate()] // 2加入插件
})
